package com.easyboot.utils.log;

import java.util.concurrent.ConcurrentLinkedQueue;

/**
 * @author yushuo
 * @className
 * @descripton TODO
 * @date 2021/6/25 11:13
 **/
public class LoggerQueueInstance {
    private static final ConcurrentLinkedQueue<LogDto> logQueue=new ConcurrentLinkedQueue<LogDto>();


    /* *
     * @author yushuo
     * @description  队列写日志
     * @date 11:16 2021/6/25
     * @param [logDto]
     * @return void
    **/
    public static void add(LogDto logDto){
       logQueue.add(logDto);
    }

    /**
    *
     * @author yushuo
     * @description 获取log
     * @date 11:18 2021/6/25
     * @param []
     * @return com.easycms.common.log.LogDto
    **/
    public static LogDto getLog(){
         LogDto log=logQueue.poll();
         return log;
    }


    /**
    *
     * @author yushuo
     * @description 清空队列
     * @date 11:19 2021/6/25
     * @param []
     * @return
    **/
    public static void clealAll(){
        logQueue.clear();
    }

}
